from google.appengine.ext.db import djangoforms

from django import forms

from people.models import Invite
from helpers.choices import PERMISSION_CHOICES
from helpers.misc import new_skey


class InviteForm(djangoforms.ModelForm):
        user = forms.CharField(max_length=100)
        mask = djangoforms.ModelChoiceField(choices=PERMISSION_CHOICES, 
						reference_class=Invite, 
						empty_label = "Please select Permission", 
						required=True)
	entry_k = forms.CharField()
        def create(self, data):
                return Invite(user = data['user'], entry = data['entry'], permission = data['mask']).save()
